/*
 * TimerRelay.h
 *
 *  Created on: 2012. 10. 22.
 *      Author: dalxx
 */
#include "PLCConfig.h"

#ifndef TIMERRELAY_H_
#define TIMERRELAY_H_

#include "RelayDL.h"
namespace PLCLib {
struct TimerDesc
{
	unsigned int delay;
	unsigned int duration;
	unsigned long start;
	bool isExcited;
};
class RelayTimer: public RelayDL {
protected:

	TimerDesc* timerList;
public:

	RelayTimer();
	~RelayTimer();
	void init(int num_relay, Relay* relay_list,RelayContainer* relay_container);
	void removeAll();
	void calculateNext();
	void setRelay(int index, char* logic, int size, unsigned int delay, unsigned int duration );

};

} /* namespace PLCLib */
#endif /* TIMERRELAY_H_ */
